package com.example.blogspring.config;

import com.example.blogspring.common.HttpResult;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @author : niu niu
 * @version : 1.0.0
 * @date : 2023/5/22 4:56
 */
@ControllerAdvice
@ResponseBody
public class ExceptionAdvice {
    @ExceptionHandler(Exception.class)
    public HttpResult exceptionAdvice(Exception e){
        return HttpResult.fail(0,"内部异常,请联系管理员！",null);
    }
}
